﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GridView转Excel.aspx.cs" Inherits="GridView转Excel" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div style="margin: 20px;">
            <asp:GridView ID="gvRecord" runat="server" AllowPaging="True" PageSize="5" AutoGenerateColumns="False"
                AllowSorting="True" OnPageIndexChanging="gvRecord_PageIndexChanging" OnRowCreated="gvRecord_RowCreated">
                <Columns>
                    <asp:BoundField DataField="ID" HeaderText="ID" />
                    <asp:BoundField DataField="Name" HeaderText="姓名" />
                    <asp:BoundField DataField="TeleNum" HeaderText="手机号" />
                    <asp:BoundField DataField="Address" HeaderText="地址" />
                    <asp:BoundField DataField="PostCode" HeaderText="邮编" />
                    <asp:BoundField DataField="City" HeaderText="城市" />
                </Columns>
            </asp:GridView>
            <p>
            
            <table>            
                <asp:Button ID="btnExcel" runat="server" Text="Statements
" OnClick="btnExcel_Click" /></p>
        </div>
    </div>
    </form>
</body>
</html>
